import * as icons from '@element-plus/icons-vue'
import { App } from 'vue'

const supportIcons = [
  'ElementPlus',
  'Avatar',
  'Plus',
  'Minus',
  'Search',
  'Delete',
  'Male',
  'Aim',
  'Folder',
  'MoreFilled',
  'Sort',
  'ArrowRight',
  'Edit',
  'Share',
  'House',
  'Loading',
  'Link',
  'Star',
  'Position',
  'Bell',
  'StarFilled',
  'InfoFilled',
  'CircleCheckFilled',
  'Menu',
  'DocumentAdd',
  'Document',
  'Notebook',
  'List',
  'Checked',
  'Failed',
  'Iphone',
  'Platform',
  'Location',
  'Bicycle',
  'PictureFilled',
  'Notification',
  'Unlock',
  'Lock',
  'InfoFilled',
  'WarnTriangleFilled',
  'Promotion',
  'HelpFilled',
  'Comment',
  'Histogram',
  'Message',
  'KnifeFork',
  'MilkTea',
  'Cherry',
  'Sunrise',
  'Sunny',
  'MostlyCloudy',
  'Drizzling',
  'Cloudy',
  'Moon',
  'ChatLineSquare',
  'Select',
  'Switch',
  'Hide',
  'View',
  'Calendar',
  'AlarmClock',
  'Remove',
  'Check',
  'ArrowDown',
  'ArrowUp',
  'Close'
]

export {
  supportIcons
}

export default function registerIcon(app: App) {
  for(let icon in icons) {
    if (supportIcons.indexOf(icon) >= 0) {
      app.component(icon, (<never>icons)[icon])
    }
  }
  return app
}
